package com.yvon.maple.service.canal.listener;

import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@CanalTable(value = "system_user")
@Component
@Slf4j
public class AdItemsHandler implements EntryHandler<Object> {

    @Override
    public void insert(Object adItems) {
        //加载缓存
        log.info(JSONUtil.toJsonStr(adItems));
    }

    /***
     * 修改
     * @param before
     * @param after
     */
    @Override
    public void update(Object before, Object after) {
		log.info("before" + JSONUtil.toJsonStr(before));
		log.info("after" +JSONUtil.toJsonStr(after));
    }

    @Override
    public void delete(Object adItems) {
        //删除缓存
		log.info(JSONUtil.toJsonStr(adItems));
    }
}
